<?php

namespace Part09_PrototypeMode\Code2;

require_once '../../autoload.php';

$p1 = new ConcretePrototype1('I');
$c1 = $p1->cloneObj();
echo $c1->getId() . "\n";   // I

// c1重新改变值，p1并不受影响
$c1->setId('P');
echo $p1->getId() . "\n";  // I
echo $c1->getId() . "\n";  // P